/* eslint-disable react/jsx-no-bind */
import React from 'react';
import { Row, Col } from 'antd';
import logo_yz from '@/assets/bigScreen/logo_yz.png';
import logo_yl from '@/assets/bigScreen/logo_yl.png';
import classNames from 'classnames';
import styles from './index.less';

const config = {
  zyyz: {
    logo: logo_yz,
    title: '中邮驿站',
  },
  zyyl: {
    logo: logo_yl,
    title: '中邮驿路',
  },
};

const ScreenLogo = props => {
  const { platform, onClick, size = 'normal' } = props;

  const handelClick = type => {
    onClick && onClick(type);
  };

  const logoCls = classNames(styles.logoImg, {
    [styles.logoImgSmall]: size == 'small',
  });
  const titleCls = classNames(styles.title, {
    [styles.titleSmall]: size == 'small',
  });

  return (
    <Row type="flex" align="middle" onClick={handelClick.bind(null, platform)}>
      <Col className={logoCls}>
        <img src={config[platform].logo} alt="logo" />
      </Col>
      <Col className={titleCls}>{config[platform].title}</Col>
    </Row>
  );
};

export default ScreenLogo;
